﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Models;
using BLL;
namespace UI
{
    public partial class denglu : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            Models.Consumer1 cus = new Consumer1();
            cus.Phone = this.TextBox1.Text.Trim();
            cus.PassWord = this.TextBox2.Text.Trim();

            if (BLL.ChaBLL.Cha(cus).Rows.Count == 1)
            {
                Session["name"] = BLL.ChaBLL.ChaName(cus);
                Response.Write("<script>alert('登陆成功！');window.location.href='index.aspx';</script>");
            }
            else
            {
                Response.Write("<script>alert('账号或密码错误！');</script>");
            }
       
        }
        protected override void OnPreRender(EventArgs args)
        {
            base.OnPreRender(args); TextBox2.Attributes["value"] = TextBox2.Text;
        }
    }
}